home *** CD-ROM | disk | FTP | other *** search
- Global SearchStr(100) As String
- Global RepStr(100) As String
- Global NumStrings As Integer
- Dim Replacements As Long
- Dim TotalReplacements As Long
- Global CaseSensitivity As Integer
-
-
- 'This routine is called after each file is closed and
- 'all processing for that file is finished.
- Sub AfterAFile ()
- WriteToStatus Replacements & " substitutions made."
- TotalReplacements = TotalReplacements + Replacements
- End Sub
-
- 'This routine is called at the very end of the program,
- 'after all files have been processed.
- Sub AfterAllFiles ()
- WriteToStatus "TOTAL # OF SUBSTITUTIONS: " & TotalReplacements
- End Sub
-
- 'The return value of BeforeAFile is usually True, which
- 'indicates that the current file is to be processed
- 'normally. By returning False, you can skip processing
- 'the current file.
- Function BeforeAFile ()
- Replacements = 0
- BeforeAFile = True
- End Function
-
- 'This routine is executed at the very beginning of the
- 'application, before any files are opened or any
- 'processing has taken place.
- Function BeforeAllFiles () As Integer
- APPNAME = "Multi-Grep"
- MultiGrep.Show 1
- If MultiGrep.Tag = "Cancel" Then
- BeforeAllFiles = False
- Else
- BeforeAllFiles = True
- End If
- End Function
-
- 'This routine called over and over, each time being
- 'passed a succeeding line of the file being
- 'processed. Or, in binary mode, this routine is passed
- 'a chunk of bytes as long as RECLEN, except for the
- 'final chunk which may be smaller than RECLEN.
- Function DoALine (TheLine As String) As Integer
- For i% = 0 To NumStrings - 1
- Replacements = Replacements + gsub(TheLine, SearchStr(i%), RepStr(i%))
- Next i%
- DoALine = True
- End Function
-
-